import http from '@/utils/http';
 //export const baseUrl = 'http://yapi.dataofx.com/mock/262/api/v1';//服务器域名
//export const baseUrl = 'http://192.168.2.56:8008/api/v1';//服务器域名
export const baseUrl = 'https://jxfz.dataofx.com/student/api/v1';//服务器域名
export const fileUploadUrl = `${baseUrl}/fileinfo/upload`;

export const h5_url='https://jxfz.dataofx.com/#';//h5的域名配置 //http://192.168.0.106:6060/
const paths = {
    getAllCommonType: `${baseUrl}/common-type/all`,
    wxLogin: `${baseUrl}/student/wechat/login`,
    studentBindWX: `${baseUrl}/student/wechat/bind`,
    fileUpload: `${baseUrl}/fileinfo/upload`,
    getHomeNotice: `${baseUrl}/notice/home`,
    getHomeBanner: `${baseUrl}/common-banner`,
};
/**
 * 获取首页课程分类和考试分类
 * @param {*} data :{code:(课程:COURSE,考试:PAPER)}
 * @param {*} callback 
 * @returns 
 */
export function getAllCommonType (data, callback) {
    return http.get(paths.getAllCommonType, { data, noLogin: true }, callback);
}
export function wxLogin (data, callback) {
    return http.post(paths.wxLogin, { data, noLogin: true }, callback);
}
export function studentBindWX (data, callback) {
    return http.post(paths.studentBindWX, { data, noLogin: true }, callback);
}
export function uploadFile (data, callback) {
    return http.post(paths.fileUpload, { data, noLogin: true }, callback);
}
export function getHomeNotice (data, callback) {
    return http.get(paths.getHomeNotice, { data, noLogin: true }, callback);
}
export function getHomeBanner (data, callback) {
    return http.get(paths.getHomeBanner, { data }, callback);
}